let num = 3526
var minimumSum = function(num) {
    let qian = Math.floor(num/1000)
    let bai = Math.floor((num%1000)/100)
    let shi = Math.floor((num%100)/10)
    let ge  = num%10
    let arr = [qian,bai,shi,ge]
    for(let i=0;i<arr.length-1;i++){
        for(let j=i+1;j<arr.length;j++){
            if(arr[i]>arr[j]){
                [arr[i],arr[j]] = [arr[j],arr[i]]
            }
        }
    }
    return [arr[0]*10+arr[2],arr[1]*10+arr[3]]    
};
console.log(minimumSum(num));

